import { IPSDEDRSysDER1NItem } from './ipsdedrsys-der1-nitem';
import { PSDEDRItemImpl } from './psdedritem-impl';
import { IPSSysImage } from '../../res/ipssys-image';

export class PSDEDRSysDER1NItemImpl extends PSDEDRItemImpl implements IPSDEDRSysDER1NItem {
  protected pssysimage: IPSSysImage | null = null;

  getPSSysImage(): IPSSysImage | null {
    if (this.pssysimage != null) return this.pssysimage;
    const value = this.M.getPSSysImage;
    if (value == null) {
      return null;
    }
    this.pssysimage = this.getPSModel4('res.IPSSysImage', value, 'getPSSysImage') as IPSSysImage;
    return this.pssysimage;
  }

  get psSysImage(): IPSSysImage | null {
    return this.getPSSysImage();
  }

  getPSSysImageMust(): IPSSysImage {
    const value = this.getPSSysImage();
    if (value == null) {
      throw new Error('未指定项图标资源对象');
    }
    return value;
  }

  get cls(): string {
    return 'PSDEDRSysDER1NItemImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.dr.IPSDEDRSysDER1NItem') return true;
    return super.instanceof(cls);
  }
}
